var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("CatWantFood"),
    s = t("CoinViewCom"),
    c = t("TimeWaitCom"),
    p = cc._decorator,
    l = p.ccclass,
    d = p.property,
    u =
        (p.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.waitCom = null;
                e.wantTipCom = [];
                e.coinTipNode = null;
                e.foodViewNode = null;
                e.handViewNode = null;
                return e;
            }
            e.prototype.onLoad = function () {
                this.resetView();
            };
            e.prototype.resetView = function () {
                this.handViewNode.angle = 0;
                this.waitCom.node.active = !1;
                for (var t = 0; t < this.wantTipCom.length; t++) this.wantTipCom[t].node.active = !1;
                this.coinTipNode.node.active = !1;
                this.foodViewNode.spriteFrame = null;
            };
            e.prototype.unStatus = function () {
                this.resetView();
            };
            e.prototype.viewWait = function (t, e, o) {
                this.resetView();
                this.waitCom.node.active = !0;
                this.waitCom.playTimeCheck(t, e, o);
            };
            e.prototype.wantFood = function (t) {
                this.resetView();
                var e = !1;
                if (this.wantTipCom.length > 0 && t) {
                    this.handViewNode.angle = 100;
                    for (var o = 0; o < this.wantTipCom.length && t.length; o++)
                        if (t[o].count > 0) {
                            this.wantTipCom[o].node.active = !0;
                            this.wantTipCom[o].wantFood(t[o].id, t[o].count);
                            e = !0;
                        }
                }
                e && QAudio.play(QAudio.effect_bubble);
                return e;
            };
            e.prototype.viewFoodTip = function (t, e) {
                this.resetView();
                this.coinTipNode.node.active = !0;
                this.coinTipNode.viewCost(e);
                SpriteView.setFoodSprite(this.foodViewNode, t);
            };
            e.prototype.getTipStr = function () {
                return this.coinTipNode.tipStringLab;
            };
            n([d(c.default)], e.prototype, "waitCom", void 0);
            n([d([r.default])], e.prototype, "wantTipCom", void 0);
            n([d(s.default)], e.prototype, "coinTipNode", void 0);
            n([d(cc.Sprite)], e.prototype, "foodViewNode", void 0);
            n([d(cc.Node)], e.prototype, "handViewNode", void 0);
            return n([l], e);
        })(cc.Component));
o.default = u;
